package com.kly.enums;

public enum OrderStatus {

    INIT(1, "初始化"),

    PAID(2, "已支付"),

    PENDING(3, "处理中"),

    CLOSE(4, "已关闭"),

    ;
    private int status;
    private String description;

    OrderStatus(int status, String description) {
        this.status = status;
        this.description = description;
    }

    public static OrderStatus fromType(int status) {

        for (OrderStatus orderStatus : values()) {
            if (orderStatus.getStatus() == status) {
                return orderStatus;
            }
        }
        return null;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
